<template>
  <div></div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
export default {
  data() {
    return {};
  },
  watch: {
    $route: {
      handler(val) {
        let { pathname } = window.location;
        if (pathname == "/privateLogin") {
          //退出登录
          this.Logout({})
            .then(() => {
              setTimeout(() => {
                window.location.reload();
              }, 16);
            })
            .catch((err) => {
              this.$message.error({
                title: "错误",
                description: err.message,
              });
            });
        } else {
          window.location.reload();
        }
      },
      immediate: true,
    },
  },
  mounted() {},
  methods: {
    ...mapActions(["Logout"]),
  },
};
</script>
<style lang="less" scoped></style>
